#include "Control.h"
#include "global.h"
Shoot::Shoot ()
{

	/*animFrames=new CCArray();

	CCSpriteFrame* pFrame0 = CCSpriteFrameCache::sharedSpriteFrameCache()
		->spriteFrameByName("shoot0.png");
	animFrames->addObject(pFrame0);
	CCSpriteFrame* pFrame1 =CCSpriteFrameCache::sharedSpriteFrameCache()
		->spriteFrameByName("shoot1.png");
	animFrames->addObject(pFrame1);
	CCSpriteFrame* pFrame2 = CCSpriteFrameCache::sharedSpriteFrameCache()
		->spriteFrameByName("shoot2.png");
	animFrames->addObject(pFrame2);*/
	this->initWithSpriteFrameName("shoot0.png");//(CCSpriteFrame *)animFrames->objectAtIndex(0));
}
//void Shoot::gotoAndStop(int i)//1 base
//{
	//this->removeAllChildren();
	//this->addChild((CCSprite *)this->animFrames->objectAtIndex(i-1));
	//this->initWithSpriteFrame((CCSpriteFrame *)this->animFrames->objectAtIndex(i-1));
//}
//Shoot::~Shoot()
//{
	//animFrames->removeAllObjects();
//	animFrames->release();
//}
Control::Control() {
	direction = CCSprite::createWithSpriteFrameName("direction.png");
	//jup=CCSprite::createWithSpriteFrameName("jiantou.png");
	//jdown=CCSprite::createWithSpriteFrameName("jiantou.png");jdown->setRotation(180);
	//jleft=CCSprite::createWithSpriteFrameName("jiantou.png");jleft->setRotation(-90);
	//jright=CCSprite::createWithSpriteFrameName("jiantou.png");jright->setRotation(90);
	shoot = new Shoot();shoot->autorelease();
	float r=direction->getContentSize().width / 2;
	CCPoint o=ccp(r,r);
	direction->setPosition(o);
	
	//jup->setPosition(ccp(o.x,o.y+r/2));
	//jdown->setPosition(ccp(o.x,o.y-r/2));
	//jleft->setPosition(ccp(o.x-r/2,o.y));
	//jright->setPosition(ccp(o.x+r/2,o.y));
	//jup->setVisible(false);
	//jdown->setVisible(false);
	//jleft->setVisible(false);
	//jright->setVisible(false);
	shoot->setPosition(ccp(global_winSize.width - direction->getContentSize().width / 2,
		direction->getContentSize().height / 2));
	addChild(direction);
	addChild(shoot);

	//addChild(jup);
	//addChild(jdown);
	//addChild(jleft);
	//addChild(jright);
}
